<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    const p = new Promise((resolve,reject)=>{
        setTimeout(function () {
            // resolve('')
            reject('err')
        },1000)
    })

    // p.then((value)=>{
    //
    // },(reason)=>{
    //     console.log(reason)
    // })

    //直接指定then的第二个参数 失败
    p.catch(function (reason) {
        console.warn(reason)
    })
</script>
</body>
</html>